﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using HMP.BL;

namespace HMP.GUI
{
    public partial class LoginForm : Form
    {
        public LoginForm()
        {
            InitializeComponent();
        }
        

        private void btnLogin_Click(object sender, EventArgs e)
        {
            //User name and Password null
            if (txtLogPassword.Text.Trim() == "" || txtLogUserName.Text.Trim() == "")
            {
                MessageBox.Show("Input User Name and Password", "Warning!", MessageBoxButtons.OK);
            }
            else
            {
                //Check username and password exist in database
                if (BL.CheckLoginBL.KTTonTai(txtLogUserName.Text, txtLogPassword.Text))
                {
                    MessageBox.Show("Log In Successful", "Message!", MessageBoxButtons.OK);
                    MainForm1 frm = new MainForm1();
                    //LoginForm.Hide();
                    frm.Show();
                }
                else
                {
                    MessageBox.Show("Log In Fail", "Message!", MessageBoxButtons.OK);
                }
            }
            
        }

        private void CheckUserNameBL()
        {
            throw new NotImplementedException();
        }

        private void CheckLogInBL()
        {
            throw new NotImplementedException();
        }

       
    }
}
